package com.jk.customer.controller;

import com.sun.org.apache.xpath.internal.operations.Mod;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class redirectWzyController {


    /**
     * 跳转询图详情页面
     */
    @RequestMapping("jumpToPictureParticulars")
    public String jumpToPictureParticulars(String queryPictureId,String productId,Model model){
        model.addAttribute("queryPictureId",queryPictureId);
        model.addAttribute("productId",productId);
        return  "pictureParticulars";
    }

    /**
     * 跳转修改询图单页面
     */
    @RequestMapping("jumpToUpdatePicture")
    public String jumpToUpdatePicture(String queryPictureId,String productId,Model model){
        model.addAttribute("orderReceivingQueryPictureId",queryPictureId);
        model.addAttribute("orderReceivingProductId",productId);
        return  "updateReceiving";
    }

    /**
     * 查看询图单详情
     * @param queryPictureId 询图单id
     * @param contacts       联系人
     * @param productName   项目名称
     * @param model
     * @return
     */
    @RequestMapping("examineQueryPirce")
    public String examineQueryPirce(String queryPictureId, String contacts,String productId, String productName,Model model){
        model.addAttribute("queryPictureId",queryPictureId);
        model.addAttribute("contacts",contacts);
        model.addAttribute("productName",productName);
        model.addAttribute("productId",productId);
        return "queryReceiving";
    }


    /**
     * 跳转接单页面
     */
    @RequestMapping("jumpToOrderReceiving")
    public String jumpToOrderReceiving(String queryPictureId,String pid,Model model){
        model.addAttribute("orderReceivingQueryPictureId",queryPictureId);
        model.addAttribute("orderReceivingProductId",pid);
        return "orderReceiving";
    }



    /**
     * 查看报价跳转
     * @param id
     * @param session
     * @return
     */
    @RequestMapping("queryOffer")
    public String toOffer(String id, HttpSession session){
        session.setAttribute("queryOfferId",id);
        return "queryOffer";
    }

    /**
     * 我要报价
     * @param showPriceId
     * @param session
     * @return
     */
    @RequestMapping("gotoOffer")
    public String gotoOffer(String showPriceId, String productId, HttpSession session){
        session.setAttribute("showPriceId",showPriceId);
        session.setAttribute("productId",productId);
        return "showMaterials";
    }



    /**
     * 更新报价回显
     */
    @RequestMapping("updateOfferWzy")
    public String updateOffer(String queryPriceId,HttpSession session){
        session.setAttribute("updateOfferId",queryPriceId);
        return "updateOffer";
    }



}
